import {handleActions} from 'redux-actions'
import {QUESTIONS,QUESTION_DETAIL,QUESTION_ANSWER} from '../types/index'

export default handleActions({
  [QUESTIONS](state,action) {
    return {
      ...state,
      idList: action.payload
    }
  },
  [QUESTION_DETAIL](state,action) {
    return {
      ...state,
      questionDetail: action.payload
    }
  },
  [QUESTION_ANSWER](state,action) {
    return {
      ...state,
      answers: action.payload
    }
  }
}, {
  idList: null,
  questionDetail:null,
  answers:[]
})
